﻿<cfsilent>
	<cfscript>
		
		event.setArg("pageTitle", "外语等级考试 - 网上报名 - 确认报名");

		sessionAdvice = getProperty("serviceFactory").getBean("sessionAdvice");
		datetimeAdvice = getProperty("serviceFactory").getBean("datetimeAdvice");
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		propAdvice = getProperty("serviceFactory").getBean("studentPropertyAdvice");

		/* 学籍相关信息 */
		studentId = sessionAdvice.getAutherUserID();
		//studentClassId = sessionAdvice.getUserProp("studentClass");
		//studentSubjectId = sessionAdvice.getUserProp("studentSubject");
		//studentDirId = sessionAdvice.getUserProp("studentSubDir");
		studentGrade = sessionAdvice.getUserProp("studentGrade");
		studentDepartment = sessionAdvice.getUserProp("studentDepartment");

		/* 学生信息 */
		 
		sql = " SELECT a.stu_id,a.stu_name,
					   a.stu_sex,a.stu_birthday,
					   t_idcard_type.idtype_name,a.stu_idcard,
					   t_nation.nation_name,a.sbj_direction 
				FROM t_student a 
					 INNER JOIN t_idcard_type ON t_idcard_type.idtype = a.idtype 
					 INNER JOIN t_nation ON t_nation.nation_code = a.nation_code 
				WHERE a.stu_id = :studentId ";	
		queryObj = new Query( datasource=application.dnsSlave ); 
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		rs_student = queryObj.execute( sql=sql ).getResult();

		/* 学生学籍信息 */
		 
		sql = " SELECT a.candidatesno,a.date_join,
					   a.status_code 
				FROM t_student_status a 
				WHERE a.stu_id = :studentId ";
		queryObj = new Query( datasource=application.dnsSlave ); 
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		rs_studentStatus = queryObj.execute( sql=sql ).getResult();
		
		/* 学生所在行政班 */
		 
		sql = " SELECT b.cls_name,b.cls_found 
				FROM t_student a 
					 INNER JOIN t_class b ON b.cls_id = a.cls_id 
				WHERE a.stu_id = :studentId ";	
		queryObj = new Query( datasource=application.dnsSlave ); 
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		rs_class = queryObj.execute( sql=sql ).getResult();	
		
		/* 班级归属专业 */
		 
		sql = " SELECT t_institute.institute_name,c.sbj_name,
					   c.sbj_id,c.level_code,
					   c.schooling_length 
				FROM t_student a 
					 INNER JOIN t_class b ON b.cls_id = a.cls_id 
					 INNER JOIN t_subject c ON c.sbj_id = b.sbj_id 
					 INNER JOIN t_institute ON t_institute.institute_id = c.institute_id 
				WHERE a.stu_id = :studentId ";
		queryObj = new Query( datasource=application.dnsSlave ); 
		queryObj.addParam( name="studentId", value=studentId, cfsqltype="cf_sql_varchar" );
		rs_subject = queryObj.execute( sql=sql ).getResult();			


		currentTab = event.getArg("TabID", "labWizard");

		passArg = structNew();
		
		if ( event.isArgDefined("EX") ) {
			structInsert(passArg, "EX", event.getArg("EX"), true);
		}
		if ( event.isArgDefined("ST") ) {
			structInsert(passArg, "ST", event.getArg("ST"), true);
		}
		if ( event.isArgDefined("P") ) {
			structInsert(passArg, "P", event.getArg("P"), true);
		}
	
		sign = event.getArg("ST");
		key = studentId & studentGrade & studentDepartment;
	
		cetTarget = decrypt(sign, key, "PBEWithMD5AndDES", "Hex");
		
	
		sql = " SELECT a.exam_id,a.exam_name,
					   a.exam_charge 
				FROM t_cet a 
				WHERE a.exam_id = :cetTarget ";
		queryObj = new Query( datasource=application.dnsSlave ); 
		queryObj.addParam( name="cetTarget", value=cetTarget, cfsqltype="cf_sql_char" );
		rs_cet = queryObj.execute( sql=sql ).getResult();
		
	
				
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('DEFAULT_EVENT')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">外语等级考试</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 edit"></i>确认报名
				</h2>
			</div>
		</div>
	</div>
</div>

<!--- 加载导航菜单 --->
<!-- stepMenu-->
<cfoutput>#event.getArg("stepMenu")#</cfoutput>
<!--/stepMenu-->

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="programCourse">
			<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labWizard">class="active"</cfif> id="labWizard" tabTarget="Wizard">在线报名表</span>
					</div>
				</div>
			<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					
					// -->
					//]]>
				</script>
				
				<div id="Wizard" class="tabContent">
					
					<cfif cetTarget neq "" and cetTarget eq event.getArg("EX") >
						
							<cfif listFind( "Cash, BankInstead, BankOnline", event.getArg("P"), ", ")>
									
									<table class="UItable withBorder">
										<tr>
											<td width="100">学号</td>
											<td colspan="3"><span class="number bold"><cfoutput>#rs_student.stu_id#</cfoutput></span></td>
											<td width="80">姓名</td>
											<td width="105"><cfoutput>#rs_student.stu_name#</cfoutput></td>
											<td style="padding:0;" width="135" height="180" valign="middle" align="center" rowspan="6"><img width="135" height="180" align="middle" src="<cfoutput>#getContextRoot()#</cfoutput>/acadmicManager/student/profile/<cfoutput>#rs_student.stu_id#</cfoutput>.jpg" /></td>
										</tr>
										<tr>
											<td><cfoutput>#rs_student.idtype_name#</cfoutput></td>
											<td><span class="number bold"><cfoutput>#rs_student.stu_idcard#</cfoutput></span></td>
											<td>性别</td>
											<td><span class="attention"><cfif rs_student.stu_sex eq "1">男<cfelse>女</cfif></span></td>
											<td>出生日期</td>
											<td><span class="number"><cfoutput>#datetimeAdvice.formatDateString(rs_student.stu_birthday)#</cfoutput></span></td>
										</tr>
										<tr>
											<td>分院(系所)</td>
											<td><cfoutput>#rs_subject.institute_name#</cfoutput></td>
											<td>学制</td>
											<td><span class="attention"><cfoutput>#rs_subject.schooling_length#</cfoutput>年</span></td>
											<td>民族</td>
											<td><cfoutput>#rs_student.nation_name#</cfoutput></td>
										</tr>
										<tr>
											<td>专业名称</td>
											<td colspan="5"><cfoutput>#rs_subject.sbj_name#</cfoutput>
												<cfif rs_student.sbj_direction eq "0">
													无
													<cfelse>
                                                    <cfset sql = "	SELECT a.sbj_name 
																	FROM t_subject a
																	WHERE a.sbj_id = :dirId " />
                                                    <cfset  queryObj = new Query( datasource=application.dnsSlave ) />
                                                    <cfset  queryObj.addParam( name="dirId", value=rs_subject.sbj_id & rs_student.sbj_direction, cfsqltype="cf_sql_varchar" )/>
                                                    <cfset  rs_direction = queryObj.execute( sql=sql ).getResult()/>
													<cfif rs_direction.recordCount >
														（<cfoutput>#rs_direction.sbj_name#</cfoutput>）
													</cfif>
												</cfif></td>
										</tr>
										<tr>
											<td>班级</td>
											<td colspan="3"><span class="attention"><cfoutput>#rs_class.cls_name#</cfoutput></span></td>
											<td>层次</td>
											<td><span class="attention"><cfoutput>#dictAdvice.getStudentLevel(rs_subject.level_code)#</cfoutput></span></td>
										</tr>
										<tr>
											<td>入学日期</td>
											<td colspan="3"><span class="number">
												<cfif rs_studentStatus.date_join eq "">
													<cfoutput>#datetimeAdvice.formatDateString(rs_class.cls_found & "01")#</cfoutput>
													<cfelse>
													<cfoutput>#datetimeAdvice.formatDateString(rs_studentStatus.date_join)#</cfoutput>
												</cfif>
											</span>
											</td>
											<td>学籍状态</td>
											<td><cfoutput>#dictAdvice.getStudentCurrentStatus(rs_studentStatus.status_code)#</cfoutput></td>
										</tr>
									</table>
									<div class="clearfix mbs"></div>
									<table class="UItable withBorder">
										<tr>
											<td width="100">报考科目</td>
											<td><span class="number bold"><cfoutput>#rs_cet.exam_id#</cfoutput></span> - <strong><cfoutput>#rs_cet.exam_name#</cfoutput></strong></td>
											<td width="80">缴费方式</td>
											<td width="105">
												<span class="attention">
													<cfswitch expression="#event.getArg('P')#">
														<cfcase value="Cash">现金</cfcase>
														<cfcase value="BankInstead">银行代扣</cfcase>
													</cfswitch>
												</span>
											</td>
											<td width="65">报名费</td>
											<td width="57"><span class="number alert"><cfoutput>#numberFormat( rs_cet.exam_charge, "__.__")#</cfoutput></span></td>
										</tr>
									</table>
									
									<form class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('cetEntryCreateDo', passArg)#</cfoutput>">
										<div class="lable"><input class="button1" type="submit" value="确认报名" /></div>
									</form>
									
								<cfelse>
									<div class="systemNotice">
										<h3><span class="img icon16x16 info"></span>未选择缴费方式</h3>
										<p>请先确认报名费的缴纳方式</p>
										<p><span class="img icon16x16 link"></span><a href="<cfoutput>#buildURL('cetEntryWizardCharge', passArg)#</cfoutput>">选择缴费方式</a></p>
									</div>
						</cfif>

						<cfelse>
							<div class="systemNotice">
								<h3><span class="img icon16x16 info"></span>未选择语言级别</h3>
								<p>您需要先选择当前报考的语言和级别</p>
								<p><span class="img icon16x16 link"></span><a href="<cfoutput>#buildURL('cetEntryWizard', passArg)#</cfoutput>">选择语言级别</a></p>
							</div>
					</cfif>
					
				</div>